﻿@{
    ViewBag.Title = "UpLoad";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<script type="text/javascript">
    $(function () {
        $("form").submit(function () {
            var myfile = $("#FileUpload").val();
            if (myfile == "") {
                alert("请选择需上传的文件！")
                return false;
            }
            else {
                var filename = myfile.replace(/.*(\/|\\)/, "");
                var fileExt = (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename.toLowerCase()) : '';
                if (fileExt == "xlsx" || fileExt == "xls") {
                    if (confirm("确认上传该值班计划！"))
                        return true;
                    else
                        return false;
                }
                else {
                    alert("上传的文件格式不正确，请重新选择！");
                    return false;
                }
            }
        });
    });
</script>

<div class="index_lr">
    <div class="index_lrA_title ui-icons">
        <h3>第一步：下载值班计划模版</h3>
    </div>
    <div class="index_pt_bg">
        <br />
         <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr>
                        <td class="tdName" width="300px">请点击"下载"按钮，下载值班计划模版</td>
                        <td class="tdData">
                            <a href="http://selfservice.fj-tobacco.com:8098/DutyPlanDoc/Exp/DutyData.xls"><b><span style="font-style:italic;">下载</span></b></a>
                        </td>
                    </tr>
                </tbody>
         </table>
        <br />
    </div>
    <div class="index_lrA_title ui-icons">
        <h3>第二步：上传值班计划Excel数据</h3>
    </div>
    <div class="index_pt_bg">
        @using (Html.BeginForm("UpLoadDutyPlan", "DutyPlan", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr>
                        <td class="tdName" width="300px">请选择需要上传的值班计划Excel文件</td>
                        <td class="tdData" width="300px">
                            <input type="file" name="FileUpload" id="FileUpload" class=":required"  />
                        </td>
                        <td>
                            <input type="submit" class="Button1 ui-icons" id="Submit" value="上传" title="确认上传" />
                        </td>
                    </tr>
                </tbody>
            </table>
        }
    </div>
</div>








